package com.tf.six.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tf.six.entity.Cart;
import com.tf.six.mapper.CartMapper;
import com.tf.six.service.CartService;
import org.springframework.stereotype.Service;

@Service
public class CartServiceImpl extends ServiceImpl<CartMapper, Cart> implements CartService {
    @Override
    public boolean updateQuantity(Integer cartId, Integer quantity) {
        Cart cart = getById(cartId);
        if(cart == null) return false;
        cart.setQuantity(quantity);
        return updateById(cart);
    }
}